#!/bin/sh

#variable definitions
INC_DIR_X86="/usr/include/comm_lib_inc_f"
LIB_DIR_X86="/usr/lib"

INC_DIR_EBD="/root/installs/mips_comm_lib_inc_f"
LIB_DIR_EBD="/root/installs/mips_comm_lib_lib_f"



#Create the include folders for pc
if [ ! -d ${INC_DIR_X86} ]
then	
	sudo mkdir ${INC_DIR_X86} 
fi

#Create the lib folders for pc
#if [ ! -d ${LIB_DIR_X86} ]
#then
#	sudo mkdir ${LIB_DIR_X86}
#fi




#Create the include folders for embeded
if [ ! -d ${INC_DIR_EBD} ]
then
	sudo mkdir ${INC_DIR_EBD}
fi
#Create the lib folders for embeded
if [ ! -d ${LIB_DIR_EBD} ]
then
	sudo mkdir ${LIB_DIR_EBD}
fi



#copy head files
sudo find . -type f -name "*.h" -exec cp {} ${INC_DIR_X86} \;
sudo find . -type f -name "*.h" -exec cp {} ${INC_DIR_EBD} \;

#if [ ! -d /usr/lib/CommLibLib_F ]
#then
#	sudo mkdir /usr/lib/CommLibLib_F
#fi
#sudo find ./Debug -name "*.a" -exec cp {} /usr/lib/CommLibLib_F \;
#sudo find ./Debug -name "*.so" -exec cp {} /usr/lib/CommLibLib_F \;

sudo cp ./Debug/libcomm_lib_fd.so		${LIB_DIR_X86}
sudo cp ./Debug_x/libcomm_lib_f_xd.so		${LIB_DIR_EBD}
sudo cp ./Release/libcomm_lib_f.so		${LIB_DIR_X86}
sudo cp ./Release_x/libcomm_lib_f_x.so		${LIB_DIR_EBD}

